load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "physicalop",
    srcs = [
        "base_physical_agg.go",
        "base_physical_join.go",
        "base_physical_plan.go",
        "enforce.go",
        "foreign_key.go",
        "fragment.go",
        "nominal_sort.go",
        "physical_apply.go",
        "physical_batch_point_get.go",
        "physical_common_plans.go",
        "physical_cte.go",
        "physical_cte_table.go",
        "physical_exchange_receiver.go",
        "physical_exchange_sender.go",
        "physical_expand.go",
        "physical_hash_agg.go",
        "physical_hash_join.go",
        "physical_index_hash_join.go",
        "physical_index_join.go",
        "physical_index_merge_join.go",
        "physical_index_reader.go",
        "physical_index_scan.go",
        "physical_indexlookup.go",
        "physical_indexlookup_reader.go",
        "physical_indexmerge_reader.go",
        "physical_limit.go",
        "physical_lock.go",
        "physical_max_one_row.go",
        "physical_mem_table.go",
        "physical_merge_join.go",
        "physical_plan_misc.go",
        "physical_projection.go",
        "physical_schema_producer.go",
        "physical_selection.go",
        "physical_sequence.go",
        "physical_show.go",
        "physical_shuffle.go",
        "physical_sort.go",
        "physical_stream_agg.go",
        "physical_table_dual.go",
        "physical_table_reader.go",
        "physical_table_sample.go",
        "physical_table_scan.go",
        "physical_topn.go",
        "physical_union_all.go",
        "physical_union_scan.go",
        "physical_utils.go",
        "physical_window.go",
        "plan_clone_generated.go",
        "task.go",
        "task_base.go",
        "tiflash_predicate_push_down.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/planner/core/operator/physicalop",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/distsql",
        "//pkg/executor/join/joinversion",
        "//pkg/expression",
        "//pkg/expression/aggregation",
        "//pkg/infoschema",
        "//pkg/kv",
        "//pkg/meta/model",
        "//pkg/parser/ast",
        "//pkg/parser/charset",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/planner/cardinality",
        "//pkg/planner/core/access",
        "//pkg/planner/core/base",
        "//pkg/planner/core/cost",
        "//pkg/planner/core/operator/baseimpl",
        "//pkg/planner/core/operator/logicalop",
        "//pkg/planner/core/resolve",
        "//pkg/planner/core/rule",
        "//pkg/planner/core/stats",
        "//pkg/planner/funcdep",
        "//pkg/planner/property",
        "//pkg/planner/util",
        "//pkg/planner/util/coreusage",
        "//pkg/planner/util/costusage",
        "//pkg/planner/util/partitionpruning",
        "//pkg/planner/util/tablesampler",
        "//pkg/planner/util/utilfuncp",
        "//pkg/sessionctx",
        "//pkg/sessionctx/stmtctx",
        "//pkg/sessionctx/vardef",
        "//pkg/sessionctx/variable",
        "//pkg/sessiontxn",
        "//pkg/statistics",
        "//pkg/table",
        "//pkg/table/tables",
        "//pkg/tablecodec",
        "//pkg/telemetry",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/chunk",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "//pkg/util/context",
        "//pkg/util/dbterror/plannererrors",
        "//pkg/util/dbutil",
        "//pkg/util/execdetails",
        "//pkg/util/hint",
        "//pkg/util/intest",
        "//pkg/util/logutil",
        "//pkg/util/plancodec",
        "//pkg/util/ranger",
        "//pkg/util/ranger/context",
        "//pkg/util/redact",
        "//pkg/util/set",
        "//pkg/util/size",
        "//pkg/util/slice",
        "//pkg/util/stringutil",
        "//pkg/util/tiflashcompute",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_tipb//go-tipb",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "physicalop_test",
    timeout = "short",
    srcs = [
        "fragment_test.go",
        "physical_utils_test.go",
    ],
    embed = [":physicalop"],
    flaky = True,
    shard_count = 3,
    deps = [
        "//pkg/planner/core/base",
        "@com_github_pingcap_tipb//go-tipb",
        "@com_github_stretchr_testify//require",
    ],
)

filegroup(
    name = "generator_files",
    srcs = ["plan_clone_generated.go"],
    visibility = ["//visibility:public"],
)
